<HTML><HEAD><TITLE>number(?Number)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Type Testing</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>number(?Number)</H1>
Succeeds if Number is a number.


<DL>
<DT><EM>Number</EM></DT>
<DD>Prolog term.
</DD>
</DL>
<H2>Description</H2>
   Used to test whether Number is a number.  number/1 could be defined as

<P>
<PRE>
   number(X) :- integer(X).
   number(X) :- rational(X).
   number(X) :- float(X).
   number(X) :- breal(X).
</PRE>

<H3>Modes and Determinism</H3><UL>
<LI>number(?) is semidet
</UL>
<H3>Fail Conditions</H3>
Fails if Number is not a number
<H2>Examples</H2>
<PRE>
   Success:
   number(10).
   number(-21.0).
   number(1_3).
   number(3e27).
   Fail:
   number(pi).
   number(e).
   number('-21.0').
   number(X).
   number(fred).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/typetest/atomic-1.html">atomic / 1</A>, <A HREF="../../kernel/typetest/integer-1.html">integer / 1</A>, <A HREF="../../kernel/typetest/breal-1.html">breal / 1</A>, <A HREF="../../kernel/typetest/rational-1.html">rational / 1</A>, <A HREF="../../kernel/typetest/float-1.html">float / 1</A>, <A HREF="../../kernel/typetest/real-1.html">real / 1</A>
</BODY></HTML>
